<%@page import="java.util.Vector"%>
<%@page import="login.LoginVo"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<style>
#join_main {
	width: 800px;
	height: 570px;
	font-family: 'Nanum Gothic', sans-serif;
}

#join_top {
	width: 800px;
	color: white;
	background-color: #160952;
	height: 40px;
	line-height: 40px;
	vertical-align: bottom;
	font-size: 25px;
	font-weight: bold;
}

#join_center {
	width: 800px;
	height: 415px;
	padding-top : 15px;
	border-bottom: 1px solid silver;
}

#join_center_left{
	width: 600px;
	height: 415px;
	float:left;
	text-align:right;
}

#join_center_right{
	width: 200px;
	height: 415px;
	float:right;
}

#join_bottom {
	width: 800px;
	height: 70px;
	text-align: center;
}

#join_item_id, #join_item_pwd, #join_item_pwd_re, #join_item_add, #join_item_add2,
#join_item_em, #join_item_ph,  #join_item_Q, #join_item_ans{
	width: 600px;
	height: 40px;
	margin-bottom: 5px;
	font-size: 16px;
	font-weight: bold;
}


.join_center_left input{
	width: 350px;
	height: 35px;
	font-size: 22px;
	line-height: 35px;
	vertical-align: middle;
	font-family: 'Nanum Gothic', sans-serif;
}

#addr1{
	width: 240px;
	height: 35px;
}


#join_sch_btn{
	width:100px;
	float:right;
	font-size:15px;
	margin-left: 10px;
	font-family: 'Nanum Gothic', sans-serif;
}

#text_id{
	width: 240px;
	height: 35px;
	font-size: 22px;
	margin-right:10px;
	line-height: 35px;
	vertical-align: middle;
}

#mid_chek_btn{
	width:100px;
	float:right;
	font-size:15px;
	font-family: 'Nanum Gothic', sans-serif;

}

.join_center_left select{
	width: 356px;
	height: 35px;
	font-size: 20px;
	line-height: 35px;
	vertical-align: middle;
	font-family: 'Nanum Gothic', sans-serif;
}

.join_bottom input{
	width: 120px;
	height: 60px;
	color: white;
	font-size: 20px;
	font-weight: bold;
	background-color: #C90000;
	border:0.5px solid white;
	border-radius: 10px;
}

#btn_jo_join{
	background-image: url('../images/signup.png');
	background-size:100% 100%;
}

#btn_jo_cnl{
	background-image: url('../images/cancel.png');
	background-size:100% 100%;
}
.phone{
width: 50px;
height: 50px;
}

</style>

<script>
	function writeCheck() {
		var form = document.writeform;
		
		if (!form.mid.value) // form 에 있는 name 값이 없을 때
		{
			alert("아이디를 입력하세요"); // 경고창 띄움
			form.mid.focus(); // form 에 있는 name 위치로 이동
			return;
		}

		if (!form.pwd.value) {
			alert("비밀번호를 입력하세요");
			form.pwd.focus();
			return;
		}

		if (!form.pwd_check.value) {
			alert("비밀번호를 확인하세요");
			form.pwd_check.focus();
			return;
		}

		if (!form.phone.value) {
			alert("전화번호를 입력하세요");
			form.phone.focus();
			return;
		}
		if (!form.email.value) {
			alert("이메일을 입력하세요");
			form.email.focus();
			return;
		}
		if (!form.answer.value) {
			alert("질문의 답을 입력하세요");
			form.answer.focus();
			return;
		}
		
		var b = form.pwd.value;
		var c = form.pwd_check.value;
		if(b != c){
			alert("패스워드가 서로 다릅니다.");
			return;
		}
		
		 
		var d = form.hid.value;

		if (d == "null"){
			alert("아이디 중복검사를 하세요.");
			return;
		}
			
		form.submit();
	}
	
	function check(){
		var a = writeform.mid.value;
		location.href='Main.jsp?inc_content=../login/id_check.jsp&mid='+a;	
	}
	var w;
	window.onload = function(){
		var btn = document.getElementById("winopen");
		btn.onclick=function(){
			w= window.open('postsearch.jsp', '', '');
		};
	}
</script>

</head>
<body>
	<%
		
		String mid = request.getParameter("mid");
		String num = request.getParameter("num");
	
	%>
	<div id='join_main'>
		<div id='join_top'>
		Sign In
		</div>
			<form name=writeform method=post
			action="Main.jsp?inc_content=../login/join_result.jsp">
		<div id='join_center'>
		<div id='join_center_left' class='join_center_left'>
			<div id='join_item_id'>
		<input type='hidden' name='hid' value=<%=num %>>
		<%if(mid == null || mid.equals("") || num == null || num.equals("") ){ %>
			아이디　<input type='text' id='text_id' name='mid'> 
			<%}else{ %>
			아이디　<input type='text' id='text_id' name='mid' value="<%=mid%>">
			<%} %>
			<input type='button' id='mid_chek_btn' name='mid_check' value='중복확인' onclick="check();">
			</div>
			<div id='join_item_pwd'>
			비밀번호　<input type='password' name='pwd' id='pwd'>
			</div>
			<div id='join_item_pwd_re'>
			 비밀번호 확인　<input type='password' name='pwd_check' id='pwd_check'>
			</div>
			<div id='join_item_add'>
			 우편번호　<input type='text' name='addr1' id='addr1'>
			<input type="button" value="검색" id='join_sch_btn'  onclick="window.open('../login/postsearch.jsp','주소창','width=540 height=300 menuber=no status=no toolbar=no')">
			</div>
			<div id='join_item_add2'>
			 주소　<input type='text' name='addr2' id='addr2'>
			</div>
			<div id='join_item_em'>
			이메일　<input type='text' name='email'>
			</div>
			<div id='join_item_ph'>
			핸드폰　<input type='text' name='phone'>
			
			</div>
			<div id='join_item_Q'>
			질문　<select name="question" size="1">
				<option value="출신 초등학교는?">출신 초등학교는?
				<option value="아버지의 이름은?">아버지의 이름은?
				<option value="가장 기억나는 장소는?">가장 기억나는 장소는?
				<option value="좋아하는 장소는?">좋아하는 장소는?
				<option value="좋아하는 음식?">좋아하는 음식?
				<option value="가장 싫어하는 것은?">가장 싫어하는 것은?
				<option value="가장 친한 친구이름은?">가장 친한 친구이름은?
			</select>
			</div>
			
			<div id='join_item_ans'>
			답　<input type='text' name='answer'>
			</div>
		</div>
		<div id='join_center_right'></div>
		</div>
		</form>
			<div id='join_bottom' class='join_bottom'>
			<input type='button' id='btn_jo_join' value='' onclick="writeCheck();">
			<input type='button' id='btn_jo_cnl' name='' value=''
				onclick="location.href='Main.jsp?inc_content=Main_center.jsp'">
			</div>
	</div>
</body>
</html>